package Task;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            ArrayList<Integer> arr = new ArrayList<>();
            // int b = in.nextInt();
            for(int i = 0; i < n*3; i++){
                arr.add(in.nextInt());
            }
            Collections.sort(arr);
            int sum  = 0;
            for(int j = 0; j < n ; j++){
                sum += arr.get(arr.size()-2*(j+1));
            }
            System.out.println(sum);
        }
    }
}